import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

//引入element 
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

// 引入样式文件
import './styles/index.less'


import * as echarts from "echarts"

Vue.prototype.$echarts = echarts;

// 全局过滤器
Vue.filter('formDate', function (val1, data1) {
  let val = new Date(val1)
  let y = val.getFullYear()
  let m = val.getMonth() + 1
  let d = val.getDate()
  let h = val.getHours()
  let mm = val.getMinutes()
  let ss = val.getSeconds()

  m = m < 10 ? '0' + m : m;
  d = d < 10 ? '0' + d : d;
  h = h < 10 ? '0' + h : h;
  mm = mm < 10 ? '0' + mm : mm;
  ss = ss < 10 ? '0' + ss : ss;

  if (data1 && data1.includes('yyyy-dd-mm')) {
    return `${y}- ${m}-${d}`
  } else {
    return `${y}- ${m}-${d} ${h}:${mm}:${ss}`
  }

})

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')

// https://gitee.com/jiely007/vue_oa#%E6%9D%83%E9%99%90%E7%AE%A1%E7%90%86%E8%B7%AF%E7%94%B1%E8%B7%B3%E8%BD%AC
